<?php

class Footermenu_Form_Admin_Widget_Collection extends Core_Form_Admin_Widget_Standard {
	public function init() {
		parent::init ();
		
		// Set form attributes
		$this->setTitle ( 'Advanced Footer Menu' )->setAttrib ( 'id', 'form-upload' );
		
		$collections = Engine_Api::_ ()->getDbtable ( 'collections', 'footermenu' )->fetchAll ();
		
		if (count ( $collections ) > 0) {
			// Element: collection_id
			$this->addElement ( 'Select', 'collection_id', array ('label' => 'Collections' ) );
			
			$this->collection_id->addMultiOption ( 0, '' );
			foreach ( $collections as $collection ) {
				$this->collection_id->addMultiOption ( $collection->collection_id, $collection->collection );
			}
		}
	}
}